package cn.jwelll.bxcstock.viewmodel.itemmodel

import android.databinding.BaseObservable
import android.view.View
import cn.jwelll.bxcstock.common.ConstValue
import cn.jwelll.bxcstock.common.mStartActivity
import cn.jwelll.bxcstock.ui.carin.upload.CarInUploadActivity
import com.google.gson.Gson

class ItemTrainModel :BaseObservable(){
    var index=0
    var waybillCode=""
    var railwayCode =""
    var weight =0.0f
    var remark =""
    var materials = arrayListOf<ItemCarInPreviewModel>()
    open  var billCode :String=""//提单号
    open  var relationId  :String=""//发货清单号
    fun startIncar(v: View)
    {
        v.context.mStartActivity(CarInUploadActivity::class.java,
            Pair(ConstValue.INCAR_SHOW_TYPE, CarInUploadActivity.TYPE_TRAN_IN),
            Pair("waybillCode",waybillCode),
            Pair("railwayCode",railwayCode),
            Pair("billCode",billCode),
            Pair("relationId",relationId),
            Pair("targetList", Gson().toJson(materials)),
            Pair("remark",remark))
    }
}